package com.gz.spring;

import com.gz.spring.component.Car;
import com.gz.spring.component.MonsterService;
import com.gz.spring.ioc.GzSpringApplicationContext;
import com.gz.spring.ioc.GzSpringConfig;

public class AppMain {
    public static void main(String[] args) {
        GzSpringApplicationContext ioc = new GzSpringApplicationContext(GzSpringConfig.class);
        Object bean = ioc.getBean("monsterDao");
        Object bean2 = ioc.getBean("monsterDao"); //单例
        System.out.println(bean);
        System.out.println(bean2); //相同
        MonsterService monsterService = (MonsterService)ioc.getBean("monsterService");
        monsterService.m1();
        Car car = (Car)ioc.getBean("car");
    }
}
